package com.zx.config;

import com.zx.User;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author jack.wu
 * @version 1.0
 * @date 2020-03-11
 */
@EnableUserBean
public class TestAutoImport {

    /**
     * @EnableUserBean -> @Import(UserImportSelector.class) -> UserImportSelector去加载UserConfig定义的@bean
     */

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ioc = new AnnotationConfigApplicationContext(TestAutoImport.class);
        User user = ioc.getBean(User.class);
        System.out.println(user);
    }
}
